package controller

import (
	"api/api/v1/admin"
	"api/internal/service"
	"context"
)

type cArticle struct {
}

var (
	Article = cArticle{}
)

// List 列表
func (c *cArticle) List(ctx context.Context, req *admin.ArticleListReq) (res *admin.ArticleListRes, err error) {
	res, err = service.Article().List(ctx, req)
	return
}

// 新增
func (c *cArticle) Create(ctx context.Context, req *admin.ArticleCreateReq) (res *admin.ArticleCreateRes, err error) {
	err = service.Article().Create(ctx, req)
	return
}

// 更新
func (c *cArticle) Update(ctx context.Context, req *admin.ArticleUpdateReq) (res *admin.ArticleUpdateRes, err error) {
	err = service.Article().Update(ctx, req)
	return
}

// 删除
func (c *cArticle) Delete(ctx context.Context, req *admin.ArticleDeleteReq) (res *admin.ArticleDeleteRes, err error) {
	err = service.Article().Delete(ctx, req)
	return
}
